package com.study.hot.jetpack.navigation

import androidx.navigation.Navigation
import androidx.navigation.ui.NavigationUI
import com.study.base.BaseActivity
import com.study.hot.R

/**
 * <pre>
 *     author : fauks
 *     time   : 2020/03/31
 *     desc   :
 * </pre>
 */
class GoodsActivity : BaseActivity() {
    override fun generateLayoutId() = R.layout.activity_goods

    override fun initView() {
        super.initView()
        val navController = Navigation.findNavController(this, R.id.goods_container)

        //添加ActionBar支持
        NavigationUI.setupActionBarWithNavController(this, navController)
    }

    //添加ActionBar返回键退出
    override fun onSupportNavigateUp(): Boolean {
        val navController = Navigation.findNavController(this, R.id.goods_container)
        return navController.navigateUp()
    }
}